/* 
 * Author: Alexander Rauser, arauser.org
 * Date: August 2008
 * Copyright: 2008
 * Licensed under Creative Commons Attribution 3.0 Unported
 */

package org.arauser.uploader
{
	import flash.net.*;
	
	import org.arauser.uploader.controller.*;
	import org.puremvc.as3.interfaces.IFacade;
	import org.puremvc.as3.patterns.facade.Facade;
	
	
	public class ApplicationFacade extends Facade implements IFacade
	{
		
		// Define Notification name constants
		public static const STARTUP:String = "startup";
		public static const SETCONFIG:String = "setconfig";

		// Singleton ApplicationFacade Factory Method
		public static function getInstance() : ApplicationFacade
		{
			if ( instance == null ) instance = new ApplicationFacade( );
			return instance as ApplicationFacade;
		}
		// Register Commands with the Controller
		override protected function initializeController( ) : void
		{
			super.initializeController();
			registerCommand( STARTUP, StartupCommand );
		}
		
		// Startup the PureMVC apparatus, passing in a reference to the application
		// this is called from the main MXML
		public function startup( app:Uploader ) : void
		{
			sendNotification( STARTUP, app );
		}
		
	}
}